using System;

namespace Rocuna.HID.Interfaces
{
    /// <summary>
    /// Contract for all the input devices.
    /// </summary>
    public interface IInputDevice
    {
        /// <summary>
        /// Gets the name of the device.
        /// </summary>
        /// <value>
        /// The name of the device.
        /// </value>
        string DeviceName { get; }

        /// <summary>
        /// Polls this device for input status.
        /// </summary>
        void Poll();

        /// <summary>
        /// Registers action to specified event.
        /// </summary>
        /// <param name="eventType">Type of the event.</param>
        /// <param name="action">The action.</param>
        void RegisterAction(object eventType, Action<object> action);

        /// <summary>
        /// UnRegister action to specified event.
        /// </summary>
        /// <param name="eventType">Type of the event.</param>
        void UnRegisterAction(object eventType);

        /// <summary>
        /// Gets a value indicating whether this instance is active.
        /// </summary>
        /// <value>
        ///   <c>true</c> if this instance is active; otherwise, <c>false</c>.
        /// </value>
        bool IsActive { get; }

        /// <summary>
        /// Unactive the device.
        /// </summary>
        void DeActiveDevice();

        /// <summary>
        /// Activates the device.
        /// </summary>
        void ActivateDevice();

        /// <summary>
        /// Clears this instance actions.
        /// </summary>
        void Clear();
    }
}